<?php
/**
 * +-------------------------------------------------------------
 * |Caption:
 * +-------------------------------------------------------------
 * |Author: Lenny
 * +-------------------------------------------------------------
 * |Email:  1685964109@qq.com
 * +-------------------------------------------------------------
 * |Date:   2024/6/17 下午6:19
 * +-------------------------------------------------------------
 */

use think\facade\Route;

// 登录
Route::group('login', function () {
    Route::post('', 'Login/login')
         ->append(['is_captcha'=>env('EASYADMIN.CAPTCHA', 1)]);
    Route::get('out', 'Login/out');
    Route::get('captcha', 'Login/captcha');
});

// 后台初始化接口
Route::group('init', function () {
    Route::get('','Init/init');
    Route::get('index', 'Init/index');
});

// 下拉检索列表
Route::group('select',function (){
    // 角色列表
    Route::get('auth','Select/auth');
    // 菜单下拉列表
    Route::get('menu','Select/menu');
    // 角色权限节点列表
    Route::get('authorize','Select/authorize');
    // 获取上传文件列表
    Route::get('file','Select/file');
    // 项目分类列表
    Route::get('project/cate','Select/projectCate');
    // 产品分类列表
    Route::get('product/cate','Select/productCate');
    // 门店列表
    Route::get('store', 'Select/store');
});

// 管理员管理
Route::group('admin', function () {
    Route::get('list', 'Admin/list');
    Route::post('add', 'Admin/add');
    Route::post('edit', 'Admin/edit');
    Route::post('password', 'Admin/password');
    Route::post('modify', 'Admin/modify');
});

// 角色管理
Route::group('auth',function (){
    Route::get('list','Auth/list');
    Route::post('add','Auth/add');
    Route::post('edit','Auth/edit');
    Route::post('modify','Auth/modify');
    Route::post('del','Auth/delete');
    Route::post('saveAuthorize','Auth/saveAuthorize');
});

// 快捷入口
Route::group('shortcut',function (){
    Route::get('list','Shortcut/list');
    Route::post('add','Shortcut/add');
    Route::post('edit','Shortcut/edit');
    Route::post('modify','Shortcut/modify');
    Route::post('del','Shortcut/delete');
});

// 菜单管理
Route::group('menu',function (){
    Route::get('list','Menu/list');
});

// 日志管理
Route::group('log',function (){
   Route::get('list','Log/list');
});

// 项目管理
Route::group('project',function (){
    Route::get('list','Project/list');
    Route::post('add','Project/add');
    Route::post('edit','Project/edit');
    Route::post('modify','Project/modify');
    Route::post('del','Project/delete');
    //项目分类管理
    Route::group('projectCate',function (){
       Route::get('list','ProjectCate/list');
       Route::post('add','ProjectCate/add');
       Route::post('edit','ProjectCate/edit');
       Route::post('modify','ProjectCate/modify');
       Route::post('del','ProjectCate/delete');
    });
});

// 产品管理
Route::group('product',function (){
    Route::get('list','Product/list');
    Route::post('add','Product/add');
    Route::post('edit','Product/edit');
    Route::post('modify','Product/modify');
    Route::post('del','Product/delete');
    // 产品分类管理
    Route::group('productCate',function (){
        Route::get('list','ProductCate/list');
        Route::post('add','ProductCate/add');
        Route::post('edit','ProductCate/edit');
        Route::post('modify','ProductCate/modify');
        Route::post('del','ProductCate/delete');
    });
});

// 加盟店管理
Route::group('store',function (){
    Route::get('list','Store/list');
    Route::post('add','Store/add');
    Route::post('edit','Store/edit');
    Route::post('modify','Store/modify');
    Route::post('del','Store/delete');
});

// 配置管理
Route::group('config',function (){
   Route::get('info','Config/info');
   Route::post('save','Config/save');
});

// 事件管理
Route::group('event',function ()
{
    Route::get('list', 'Event/list');
    Route::post('add', 'Event/add');
    Route::post('edit', 'Event/edit');
    Route::post('modify', 'Event/modify');
    Route::post('del', 'Event/delete');
});

// 财务管理
Route::group('finance',function (){
    Route::get('list','Finance/list');
    Route::post('add','Finance/add');
    Route::post('edit','Finance/edit');
    Route::post('modify','Finance/modify');
    Route::post('del','Finance/delete');
});

